package org.zs.miracle.common.response;

import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import lombok.Getter;

/**
 * 接口响应包装类基类
 */
@Getter public abstract class AbstractResponse implements Serializable {
  
  @Serial
  private static final long serialVersionUID = 8628555509588883784L;
  
  /**
   * 响应码
   */
  @Schema(description = "响应码", example = "200")
  Integer code;
  
  /**
   * 响应信息
   */
  @Schema(description = "响应信息", example = "ok")
  String message;
  
  /**
   * 请求接口
   */
  @Schema(description = "请求接口")
  String path;
  
  /**
   * 处理结果
   */
  @Schema(description = "处理结果", example = "true")
  Boolean success;
  
  public AbstractResponse() {
  }
  
  public AbstractResponse(Integer code, String msg, String path, Boolean success) {
    this.code = code;
    this.message = msg;
    this.path = path;
    this.success = success;
  }
  
  public void setCode(Integer code) {
    this.code = code;
  }
  
  public void setMessage(String message) {
    this.message = message;
  }
  
  public void setPath(String path) {
    this.path = path;
  }
  
  public void setSuccess(Boolean success) {
    this.success = success;
  }
}